<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<?php $siteName = cr('cmsConfig.Backend.siteName');?>
	<?php echo $html->charset(); ?>
	<title>
	
		<?php
			//use title set for title tag only.else generated title.
			$pageTitle = $this->getVar('pageTitleTag');
			if(strlen($pageTitle) == 0)
			{
				$pageTitle = $title_for_layout;
			}
		?>
		<?php echo $siteName;?> :: <?php echo $pageTitle;?>
	</title>
	
	<script>
	var URL='<?php echo Configure::read("cmsConfig.Backend.siteUrl");?>/';
	var ErrorMsg = <?php echo $encodedErrorMsgs?>;
	</script>
	<?php
		echo $javascript->link(array('/js/jquery-1.9.1.min.js','/cms/js/main.js','/js/main.js','/cms/js/jquery.cookie.js', '/js/jquery-ui-1.10.3.custom.min.js', '/js/jquery.ui.datepicker-da.js', '/js/bootstrap.min.js', '/js/jquery.flexslider.js'));
		echo $html->meta('icon');
		echo $html->meta('keywords',$this->getVar('metaKeywords'));
		echo $html->meta('description',$this->getVar('metaDescription'));
//		echo $html->defaultCss(array('/cms/css/mod','/cms/css/mod_skins'));
//		echo $html->css('common');
//		echo $html->css('style');
//		echo $html->css('breadcrumb');
		echo $html->css('bootstrap.min');
		echo $html->css('bootstrap-theme.min');
		echo $html->css('font-awesome.min');
		echo $html->css('jquery-ui-1.10.3.custom.min');
		echo $html->css('flexslider');
		echo $html->css('style');
		echo $html->css('style_mobile');
		echo $javascript->getCompressedJs();
		echo $scripts_for_layout;
		echo $html->getCompressedCss();
		echo $startup_js;
		
		$metaCanonicalUrl = $this->getVar('metaCanonicalUrl');
		if($metaCanonicalUrl)
		{
			echo $html->meta(array('rel'=>'canonical'),null,array('link'=>Configure::read("cmsConfig.Backend.siteUrl").$metaCanonicalUrl));
		}
	?>

     <script type="text/javascript">
        $(document).ready(function() {  

            //datepicker
            $( "#dateinput" ).datepicker({
                "option"    :$.datepicker.regional[ "da" ]
            }); 

            $('#dateinput').datepicker('setDate', new Date());  

            //js... 
            // The slider being synced must be initialized first
              $('#carousel_small').flexslider({
                animation: "slide",
                controlNav: false,
                animationLoop: false,
                slideshow: false,
                itemWidth: 122,
                itemMargin: 5,
                asNavFor: '#slider_big'
              });
               
              $('#slider_big').flexslider({
                animation: "slide",
                controlNav: false,
                animationLoop: false,
                slideshow: false,
                sync: "#carousel_small"
              });

        });  
      </script>
</head>

<body>
<?php 
if(!isset($hideSideBars))
{
	$hideSideBars = false;
}

$search = '';
if($this->params['action'] == 'home'){
    $index = true;
    $class = 'indexpage';
}else{
    $index = false;
    $class = 'underpage';
    $search = 'box_search_under';
}
?>
<div class="wrap <?php echo $class; ?>">
    <header id="header">
	<div class="navbar navbar-fixed-top" id="navbar">
            <div class="container">
              <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                </button>
                 <h1>
                    <?php 
                            echo $this->element('site_logo');
                    ?>
                 </h1>
              </div><!--navbar-header-->
              <?php 
                        echo $this->element('navigation_links');
               ?>
            </div><!--/.container-->
        </div><!--/#navbar-->
    </header> <!-- /#header -->
    <?php
    if($index){
    ?>
    <section id="slider">
        <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
            <?php
            if(isset($section))
            {
                    echo $section->render('slider');
            }
            ?>
            <a class="slide-left" href="#carousel-example-generic" data-slide="prev"></a>
            <a class="slide-right" href="#carousel-example-generic" data-slide="next"></a> 
       </div><!--/.slide-->
    </section> <!-- /#Slider -->
    <?php 
    }
    ?>
    <section class="box_search <?php echo $search; ?>">
            <?php
            if(isset($section))
            {
                    echo $section->render('header_right');
            }
            ?>
            <div class="text_more">
                    <div class="container"> 
                            <?php 
                            if(!$index){
                                if(!isset($breadCrumbVars))
                                {
                                        $breadCrumbVars = array();
                                }					
                                if(cr('GeneralConfig.enable_breadcrumb') == 1)
                                {
                                        if(isset($breadCrumb))
                                        {	
                                                $breadCrumb->breadCrumbElement = "bread_crumb_app";
                                                echo $breadCrumb->showFromPresentUrl();
                                        }
                                }
                            }
                            ?>
                            <!--p>Browse listings by location: <span>California, New York, Illinois, Florida </span>  <a class="more_link a_more" href="#">More ..</a><a class="more_link a_hide" href="#">Less ..</a></p>-->
                            <?php
                                if(isset($section))
                                {
                                    echo $section->render('location_bar');
                                }
                            ?>
                    </div> <!--container-->
            </div><!--text_more-->
    </section><!--box_search-->	
    <?php 
            $session->flash();	
    ?>
    <?php
    if($index){ 
    ?>
        <?php
        if(isset($section))
        { ?>
        <section class="hauptseite"> 
            <div class="container"> 
                    <div class="row">
                        <?php echo $section->render('hauptseite'); ?>
                    </div>
            </div>
        </section>
        <?php }
        ?>
        <?php
        if(isset($section))
        { ?>
        <section class="most_viewed"> 
            <div class="container"> 
                    <div class="row">
                        <?php echo $section->render('most_viewed'); ?>
                    </div>
            </div>
        </section>
        <?php }
        ?>
        <?php
        if(isset($section))
        { ?>
        <section class="new_reviews"> 
            <div class="container"> 
                    <div class="row">
                        <?php echo $section->render('new_reviews'); ?>
                    </div>
            </div>
        </section>
        <?php }
        ?>
        <?php if(isset($section))
        {
            echo $section->render('top');
            
                echo $section->render('bottom');
        }
        ?>
    
    
    <?php }else{ ?>
    <section class="hauptseite">
        <div class="container"> 
                <div class="row">
                    <?php echo $content_for_layout; ?>
                </div>
        </div>
    </section>
    <?php } ?>
    <?php echo $this->element("footer")?>
</div>
<?php echo $cakeDebug; ?>	
</body>
</html>